<template>
  <div>
    <h4>添加删除餐桌-哪些餐桌是空闲哪些是堂食查看餐桌详情,点荣信息可以加菜
</h4>
<div class="upbox">
  <!-- 输入框 -->
  <span style="margin:20px">餐桌编号</span>
<el-input  placeholder="请输入查询内容" style="width:200px"></el-input>
<!-- 按钮 -->
<el-button type="primary" style="width:90px;margin-left:20px">查询</el-button>

<el-button type="text" @click="dialogFormVisible = true">添加按钮</el-button>

<el-dialog title="收货地址" :visible.sync="dialogFormVisible">
  <el-form :model="form">
  <!-- 弹框-桌号 -->
    <el-form-item label="桌号" :label-width="formLabelWidth">
      <el-input v-model="form.name" autocomplete="off"></el-input>
    </el-form-item>

<!-- 弹框 使用状态 -->
 <el-form-item label="使用状态" :label-width="formLabelWidth">
  <el-switch
      v-model="value1"
      active-text="使用中"
      inactive-text="未使用" style="float:left;">
      </el-switch>
    </el-form-item>
 

<!-- 弹框餐桌位数 填写 -->
<el-form-item label="餐桌位数" :label-width="formLabelWidth">
      <el-input v-model="form.name" autocomplete="off"></el-input>
    </el-form-item>

<!-- 餐桌类型 -->
    <el-form-item label="餐桌类型" :label-width="formLabelWidth">
      <el-select v-model="form.region" placeholder="请选择" style="width:200px;float:left">
        <el-option label="区域一" value="shanghai"></el-option>
        <el-option label="区域二" value="beijing"></el-option>
      </el-select>
    </el-form-item>

<!-- 订餐时间 -->
<el-form-item :label-width="formLabelWidth" label="订餐时间">
<div class="block" style="float:left;">
    <!-- <span class="demonstration">设置默认时间</span> -->
    <el-date-picker
      v-model="value3"
      type="datetime"
      placeholder="选择日期时间"
      default-time="12:00:00">
    </el-date-picker>
  </div>
  </el-form-item>

<!-- 就餐人数 -->
<el-form-item label="就餐人数" :label-width="formLabelWidth">
      <el-input v-model="form.name" autocomplete="off"></el-input>
    </el-form-item>

<!-- 是否结账 -->
<el-form-item label="是否结账" :label-width="formLabelWidth">
  <el-switch
      v-model="yes"
      active-text="是"
      inactive-text="否" style="float:left;">
      </el-switch>
    </el-form-item>
  </el-form>
  <div slot="footer" class="dialog-footer">
    <el-button @click="dialogFormVisible = false">取 消</el-button>
    <el-button type="primary" @click="dialogFormVisible = false">确 定</el-button>
  </div>
</el-dialog>
</div>

<!-- 表单 -->
     <el-table
    :data="tableData"
 
    style="width: 90%">
    <el-table-column
      prop="food_table_number"
      label="桌号"
      width="200">
    </el-table-column>
    
    <el-table-column
      prop="food_table_action"
      label="使用状态">
  <template slot-scope="scope">
 <el-switch
  v-model="value1"
  active-text="按月付费"
  inactive-text="按年付费" @click="handleClick(scope.row)" >
</el-switch>
  </template>
    

    </el-table-column>

    <el-table-column
      prop="food_table_seat"
      label="餐桌位数"
      width="200">
    </el-table-column>

     <el-table-column
      prop="food_table_usingTime"
      label="开桌时间"
      width="240">
    </el-table-column>

     <el-table-column
      prop="food_table_type"
      label="餐桌类型"
      width="200">
    </el-table-column>

     <el-table-column
      prop="food_table_peoples"
      label="就餐人数"
      width="200">
    </el-table-column>

     <el-table-column
      prop="date"
      label="操作"
      width="250">
       <template slot-scope="scope">
        <el-button @click="handleClick(scope.row)" type="text" size="small">点菜</el-button>
        <el-button type="text" @click="open">删除</el-button>

      </template>
    </el-table-column>
  </el-table>
  <br>

  <!-- 分页 -->
  <el-pagination
  :page-size="20"
  :pager-count="11"
  layout="prev, pager, next"
  :total="2">
</el-pagination>
  </div>
</template>

<style>
.upbox{
  width: 35%;
  height: 70px;
  float: left;
}
</style>
<script>
export default {
  data() {
      return {
        // 表单渲染
        tableData: [ 
        {"id":'',
        "food_table_number":'',
        "food_table_action":'',
        "food_table_seat":'',
        "food_table_usingTime":'',
        "food_table_type": '',
        "food_table_peoples":'',
        "food_table_account":''
        }
        ],


         dialogTableVisible: false,
        dialogFormVisible: false,
        form: {
          name: '',
          region: '',
          date1: '',
          date2: '',
          delivery: false,
          type: [],
          resource: '',
          desc: ''
        },
        formLabelWidth: '120px',
        // 滑块（用餐）
        value1: true,
        
      }
    },
  methods: {
      respost(){
        this.$axios({
          url:'/selectAllFoodTable',
          methods:'get',
          data:{

          }
        }).then(res => {
          console.log(res);
          if(res.data.code == 200){
            this.tableData = res.data.data
          }
        })
      },


input(){},
value3(){},
yes(){},


 open() {
        this.$confirm('此操作将删除该信息, 是否继续?', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          this.$message({
            type: 'success',
            message: '删除成功!'
          });
        }).catch(() => {
          this.$message({
            type: 'info',
            message: '已取消删除'
          });          
        });
      }
  },
  created () {

  },
  mounted () {

  },
  computed: {

  }
};
</script>

<style scoped lang="less">
</style>
